﻿using System.Collections;
using System.Collections.Generic;
using INTEX.DataBase.Tools;
using ReflectionStudio.Core;
using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.IO;
using WPFExcelReport.Helpers;
namespace WPFExcelReport
{
   
    public partial class ITXEXRPT
    { 
        public string ITXPrint(ref bool IsReturn)
        {
            Helper.GetDate(ref date, ref year, ref month, ref day);
            switch (DocType)
            {
                case "ABCOMPARE":
                    destfolder = SetFolder(Root, "ITX");
                    #region====文件命名==============
                    order = DateTime.Now.ToLocalTime().ToFileTime().ToString();
                    DestFile = destfolder + "\\ITX" + order + ".xls";
                    #endregion
                    #region=====空白文档=======
                    Standard = "ABCOMPARE";
                    exAgent.CreateNewSheet(temp + ".xls", Standard);
                    tempfile = exAgent.FileName;
                    #endregion
                    ABCOMPARE();
                    break;
                case "ITXPRN":
                    destfolder = SetFolder(Root, "ITX");
                    #region====文件命名==============
                    order = DateTime.Now.ToLocalTime().ToFileTime().ToString();
                    DestFile = destfolder + "\\ITX" + order + ".xls";
                    #endregion
                    #region=====空白文档=======
                    Standard = "ABCOMPARE";
                    exAgent.CreateNewSheet(temp + ".xls", Standard);
                    tempfile = exAgent.FileName;
                    #endregion
                    ITXPRN("");
                    break;
                case "LOADEXCEL":
                    if (destfolder == "")
                    {
                        destfolder = @"C:\IntexReport\Data\ITX\EXCEL";
                    }
                    order = DateTime.Now.ToLocalTime().ToFileTime().ToString();
                    DestFile = destfolder.Replace(@"\ITX\EXCEL", "\\ITX\\03Done\\p_" + order + ".xls");
                    SetExchange = LoadExcelData(destfolder, prefix);
                    break; 
            
            }
            return filename;
        }
    
    }
}
